import time

from selenium.webdriver.common.by import By

from utils.webdriver_factory import WebDriverFactory

driver = WebDriverFactory.get_instance()
driver.get('http://www.baidu.com')
time.sleep(3)
driver.find_element(By.ID, 'kw').send_keys('java')
time.sleep(5)

script = 'window.scrollTo(0,2000)'
# 执行js脚本
driver.execute_script(script)
time.sleep(3)
